package com.example.demo.service;

import com.example.demo.annotation.DistributedLock;
import org.springframework.stereotype.Component;

/**
 * @Auther Created by l.wang on 2019/1/17.
 */
@Component
public class TestService {

    @DistributedLock("'lockName' + #id + #name") // lockName 锁命名、id和name是需要加锁的参数，根据id+name参数进行加锁
    public void test(String id,String name,int age){
        System.out.println("开始");
    }
}
